package com.yz.yzl00.config;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

@Component
public class MyMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        Object remark = getFieldValByName("name", metaObject);
        if (null == remark) {
            setFieldValByName("name", "好好学习", metaObject);
        }
    }
 
    @Override
    public void updateFill(MetaObject metaObject) {
  //自定义更新时填充
    }
}